/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package creature;

import java.awt.Color;
import world.World;

/**
 *
 * @author leadiv
 *  By Default a creature is a small green 1 pixel dot that runs north to south.
 */
public class NorthSouthBug extends Creature {

    public NorthSouthBug(int x, int y, int id) {
        super(x,y,id);
        this.setSkinColor(new Color(0,0,155));
    }
    
    @Override
    public void move(World w) 
    {   
        int direction = (int)(Math.random() * 5);
        switch(direction)
        {
            case 0:
                w.place(this.getX()+1, this.getY()-1, this.getId());
                break;
            case 1:
                w.place(this.getX()-1, this.getY()-1, this.getId());
                break;
            case 2:
                w.place(this.getX(), this.getY()-1, this.getId());
                break;
            case 3:
                w.place(this.getX(), this.getY()+1, this.getId());
                break;
            default:
                w.place(this.getX(), this.getY()-1, this.getId());
        }
    }
}
